package com.zis.auction.web;

import com.zis.auction.model.Essay;
import com.zis.auction.service.IEssayInter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Create by wangshen 2018/1/15
 */
@RestController
@RequestMapping("/api/open/auction/essay")
public class EssayRestful {

    @Autowired
    private IEssayInter essayInter;

    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    public String pageList(@RequestParam String msgType, @RequestParam Integer page,
                           @RequestParam Integer pageSize) throws Exception {
        return essayInter.findByPage(msgType,page,pageSize);
    }

    @RequestMapping(value = "/view/{msgId}", method = RequestMethod.GET)
    @ResponseBody
    public Essay msgView(@PathVariable("msgId") String msgId) throws Exception{
        return essayInter.selectById(msgId);
    }
}
